export default function (req, res) {
    const mockData = [];
    const names = ["张伟", "王芳", "李明", "赵丽", "刘洋", "陈静", "周涛", "吴磊", "郑凯", "孙悦"];
    const genders = [1, 2]; // 1: 女, 2: 男
    const avatars = [
      "http://127.0.0.1:9999/libs/images/boy.png",
      "http://127.0.0.1:9999/libs/images/girl.png"
    ];
    const grades = ["一年级", "二年级", "三年级", "四年级", "五年级", "六年级", "初一", "初二", "初三", "高一", "高二", "高三"];
    const subjects = ["语文", "数学", "英语", "物理", "化学", "生物", "政治", "历史", "地理"];
    const provinces = ["北京", "上海", "广东", "江苏", "浙江", "四川"];
    const cities = ["北京", "上海", "广州", "深圳", "南京", "杭州", "成都"];
    const districts = ["海淀区", "朝阳区", "浦东新区", "天河区", "武侯区", "西湖区"];
    const teachers = [
      { id: 1, name: "张三" },
      { id: 2, name: "李四" },
      { id: 3, name: "王五" }
    ];
    const videoNames = [
      "如何高效学习数学",
      "英语口语速成技巧",
      "物理实验大揭秘",
      "探寻历史的奥秘",
      "用化学点亮生活",
      "生物的多样性世界"
    ];
    const videoDescs = [
      "本视频详细讲解了数学学习的核心方法，帮助你轻松掌握知识点。",
      "跟着我练习，让你的英语口语像母语一样流利。",
      "一起走进物理实验室，探索那些神奇的物理现象。",
      "从古至今，串联历史脉络，带你领略不一样的历史故事。",
      "揭开化学反应的神秘面纱，你会发现化学无处不在。",
      "探索大自然的神奇，了解各种生物的生存之道。"
    ];
  
    for (let i = 1; i <= 40; i++) {
      const gender = genders[Math.floor(Math.random() * genders.length)];
      const city = cities[Math.floor(Math.random() * cities.length)];
      const videoIndex = Math.floor(Math.random() * videoNames.length);
      const createdAt = new Date(Date.now() - Math.floor(Math.random() * 365) * 24 * 60 * 60 * 1000);
      const updatedAt = new Date(createdAt.getTime() + Math.floor(Math.random() * 24) * 60 * 60 * 1000);
  
      mockData.push({
        id: i,
        name: names[Math.floor(Math.random() * names.length)],
        gender: gender,
        mobile: `191${String(Math.floor(Math.random() * 100000000)).padStart(8, '0')}`,
        avatar: gender === 2 ? "http://127.0.0.1:9999/libs/images/boy.png" : "http://127.0.0.1:9999/libs/images/girl.png",
        stage: Math.floor(Math.random() * 3) + 1, // 1:小学, 2:初中, 3:高中
        grade: grades[Math.floor(Math.random() * grades.length)],
        subject: subjects[Math.floor(Math.random() * subjects.length)],
        province: provinces[Math.floor(Math.random() * provinces.length)],
        city: city,
        status: Math.random() > 0.5 ? "true" : "false",
        amount: Math.floor(Math.random() * 1000) + 50,
        district: districts[Math.floor(Math.random() * districts.length)],
        teacher: teachers[Math.floor(Math.random() * teachers.length)],
        star: Math.floor(Math.random() * 5) + 1,
        created_at: `${createdAt.getFullYear()}-${String(createdAt.getMonth() + 1).padStart(2, '0')}-${String(createdAt.getDate()).padStart(2, '0')} ${String(createdAt.getHours()).padStart(2, '0')}:${String(createdAt.getMinutes()).padStart(2, '0')}:${String(createdAt.getSeconds()).padStart(2, '0')}`,
        updated_at: `${updatedAt.getFullYear()}-${String(updatedAt.getMonth() + 1).padStart(2, '0')}-${String(updatedAt.getDate()).padStart(2, '0')} ${String(updatedAt.getHours()).padStart(2, '0')}:${String(updatedAt.getMinutes()).padStart(2, '0')}:${String(updatedAt.getSeconds()).padStart(2, '0')}`,
        video: {
          id: (1000 + i).toString(),
          src: "https://www.w3school.com.cn/i/movie.ogg",
          duration: `00:${String(Math.floor(Math.random() * 59)).padStart(2, '0')}`,
          name: videoNames[videoIndex],
          desc: videoDescs[videoIndex],
          poster: "http://127.0.0.1:9999/libs/images/boy.png"
        }
      });
    }
  
    return {
        code: 0,
        message: 'success',
        data: {
            list: mockData,
            "total": 722,
		"p": 1,
		"pn": 20,
		"summary": {
			"count1": "1000",
			"count2": "400",
			"count3": "1400",
			"count4": "2300",
			"count5": "1100"
		},
        },
    }
  }